{template header member}		
<script type="text/javascript" src="{__ROOT__}statics/js/haidao.validate.js"></script>
<link type="text/css" rel="stylesheet" href="<?php echo __ROOT__;?>statics/js/upload/uploader.css" />
<script type="text/javascript" src="<?php echo __ROOT__;?>statics/js/upload/uploader.js"></script>
		<div class="margin-big-top layout">
			<div class="container border border-gray-white member clearfix">
				<div class="left padding-big">
					<div class="user-head margin-big-left margin-big-top">
						<img src="<?php echo $this->member['avatar'];?>" height="148" />
						<span><a href="{url('member/account/avatar')}">修改头像</a></span>
					</div>
					<div class="margin-top text-center text-default"><p><?php echo $this->member['_group']['name'] ?></p></div>
					{template menu_index member}
				</div>
				<div class="right padding-top">
					<div class="margin-big-top margin-large-left margin-bottom padding-left process clearfix">
						<!--退货退款 开始-->
						{if !$_GET['type']}
						{if $server['status'] == -1}
						<ul class="margin-big-left">
							<li class="process-list proce-right all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">买家申请仅退款</span>
									</div>
								</div>
							</li>
							<li class="process-list proce-left all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">买家已取消退款</span>
									</div>
								</div>
							</li>
						</ul>
						{elseif $server['status'] == -2}
						<ul class="margin-big-left">
							<li class="process-list proce-right all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">买家申请仅退款</span>
									</div>
								</div>
							</li>
							<li class="process-list proce-left all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">卖家已拒绝退款</span>
									</div>
								</div>
							</li>
						</ul>
						{else}
						<ul class="margin-big-left">
							<li class="process-list proce-right all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">买家申请退货退款</span>
									</div>
								</div>
							</li>
							<li class="process-list all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">卖家处理退货申请</span>
									</div>
								</div>
							</li>
							<li class="process-list">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">买家退货给卖家</span>
									</div>
								</div>
							</li>
							<li class="process-list proce-left">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">卖家确认收货，退款完成</span>
									</div>
								</div>
							</li>
						</ul>
						{/if}
						{/if}
						<!--退货退款 结束-->
						<!--仅退款 开始-->
						{if $_GET['type'] == 'refund'}
						{if $refund == -1}
						<ul class="margin-big-left">
							<li class="process-list proce-right all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">买家申请仅退款</span>
									</div>
								</div>
							</li>
							<li class="process-list proce-left all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">买家已取消退款</span>
									</div>
								</div>
							</li>
						</ul>
						{elseif $refund == -2}
						<ul class="margin-big-left">
							<li class="process-list proce-right all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">买家申请仅退款</span>
									</div>
								</div>
							</li>
							<li class="process-list proce-left all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">卖家已拒绝退款</span>
									</div>
								</div>
							</li>
						</ul>
						{else}
						<ul class="margin-big-left">
							<li class="process-list proce-right all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">买家申请仅退款</span>
									</div>
								</div>
							</li>
							<li class="process-list all">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">卖家处理退货申请</span>
									</div>
								</div>
							</li>
							<li class="process-list proce-left {if $refund == 1}all{/if}">
								<div class="proce"></div>
								<div class="node">
									<div class="item">
										<span class="text-drak-grey">退款完成</span>
									</div>
								</div>
							</li>
						</ul>
						{/if}
						{/if}
						<!--仅退款 结束-->
					</div>
					<div class="margin-big-left margin-big-right margin-big-bottom tabs-scroll">
						<div class="border border-sub padding-big bg-blue-gray">
							<div class="double-line clearfix">
								<div class="list">
								{if $_GET['type'] == 'refund'}
									{if $refund == 0}
										<b class="text-default">您已申请成功，等待卖家处理</b>
									{elseif $refund == -2}
										<b class="text-default">您的退款申请失败，请联系人工处理</b>
									{elseif $refund == -1}
										<b class="text-default">您的退款申请已取消！</b>
									{else}
										<b class="text-default">您的退款申请已退款成功</b>
									{/if}
								{else}
									{if $server['status'] == 0}
										<b class="text-default">您已申请成功，等待卖家处理</b>
									{elseif $server['status'] == -2}
										<b class="text-default">您的退货申请失败，请联系人工处理</b>
									{elseif $server['status'] == -1}
										<b class="text-default">您的退货申请已取消！</b>
									{else}
										<b class="text-default">您的申请已通过，请退货并填写退货信息</b>
									{/if}
								{/if}
									<p class="text-gray">·如果卖家同意，您可以退货给卖家并完成退款</p>
									<p class="text-gray">·如果卖家拒绝，需要您修改退货并退款申请</p>
									<p class="text-gray">·每个商品&订单您只有一次售后维权的机会</p>
								</div>
								<div class="list margin-top">
								{if $_GET['type'] == 'refund'}
									{if $refund == 0}
										<input type="submit" class="fl margin-right button bg-gray" disabled="disabled" value="等待卖家处理">
										<input type="submit" class="fl button bg-gray cancel_refund_delivery" value="取消退货申请">
									{/if}
								{else}
									{if $server['status'] == 0}
										<input type="submit" class="fl margin-right button bg-gray" disabled="disabled" value="等待卖家处理">
										<input type="submit" class="fl button bg-gray cancel_return_delivery" value="取消退货申请">
									{elseif $server['status'] > 0}
										<a class="fl margin-right button bg-sub" href="{url('return_refund',array('id'=>$_GET['id'],'type' => 'delivery'))}">退货并填写退货信息</a>
										<input type="submit" class="fl button bg-gray cancel_return_delivery" value="取消退货申请">
									{/if}
								{/if}
								</div>
							</div>
						</div>
					</div>
					<div class="padding-big-left padding-big-right padding-big-bottom">
						<p>售后说明：<span class="text-mix">每个商品&订单您只有一次售后维权的机会</span></p>
						<p>1. <b>退货退款</b></p>
						<p>申请条件：若为商品问题，或者不想要了且与卖家达成一致退货，请选择“退货退款”选项，退货后请保留物流底单。</p>
						<p class="text-sub">退货流程：1.申请退货 >2.卖家发送退货地址给买家 >3.买家退货并填写退货物流信息 >4.卖家确认收货，退款成功</p>
						<p>2. <b>仅退款</b></p>
						<p>申请条件：若您未收到货，或已收到货且与卖家达成一致不退货仅退款时，请选择“仅退款”选项。</p>
						<p class="text-sub">退款流程：1.申请退款 > 2. 卖家同意退款申请>3.退款成功</p>
					</div>
				</div>
			</div>
		</div>
		{template footer common}
	</body>
</html>
<script>
	$(function(){
		var id = 'return';
		$(".tab-trigger .item").click(function(){
			$(".tabs-wrap").stop().animate({marginLeft:"-"+$(this).index()*928+"px"},100);
			id = $(this).data('id');
		})
		$('.cancel_return_delivery').bind('click',function(){
			var url = "<?php echo url('ajax_return_cancel')?>";
			var id = "<?php echo $_GET['id']?>";
			$.post(url,{id:id},function(ret){
				if(ret.status == 0) {
					$.tips({
						icon:'error',
						content:ret.message,
						callback:function() {
							return false;
						}
					});
				} else {
					$.tips({
						icon:'success',
						content:ret.message,
						callback:function() {
							window.location.reload();
						}
					});					
				}
			},'json')
		})
		$('.cancel_refund_delivery').bind('click',function(){
			var url = "<?php echo url('ajax_refund_cancel')?>";
			var id = "<?php echo $_GET['id']?>";
			$.post(url,{id:id},function(ret){
				if(ret.status == 0) {
					$.tips({
						icon:'error',
						content:ret.message,
						callback:function() {
							return false;
						}
					});
				} else {
					$.tips({
						icon:'success',
						content:ret.message,
						callback:function() {
							window.location.reload();
						}
					});					
				}
			},'json')
		})
	})
</script>